package com.cy.detectsys.controller.attacksurface;

import com.cy.detectsys.entity.DbIana;
import com.cy.detectsys.model.PageReqModel;
import com.cy.detectsys.model.vo.NetTargetVO;
import com.cy.detectsys.service.DbIanaService;
import com.cy.detectsys.service.DbWikiService;
import com.cy.detectsys.util.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *  【目标攻击面识别】 页面的接口
 */

@RestController
@RequestMapping("attack/surface")
public class IdentifyController {

    /***
     *
     *
     *  居然完全从  之前的表名 combine  现在换成 db_iana
     *
     * @return
     */


    @Resource
    private DbIanaService dbIanaService;
    @RequestMapping("list")
    public R identify(@RequestBody PageReqModel<NetTargetVO> pageModel) {

        return dbIanaService.queryList(pageModel);

    }

    @Resource
    private DbWikiService dbWikiService;


    /**
     * 【作战任务】 查询目标的详情
     */
    @RequestMapping("/target/details")
    public R queryTargetDetails(@RequestParam String domain){
        return dbWikiService.queryTargetDetails(domain);
    }

    @RequestMapping("/target/subdomain")
    public R queryTargetSubdomain(@RequestParam String domain){
        return dbWikiService.queryTargetSubdomain(domain);
    }
}
